package com.lxp.design.shop.gateway.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author LaiXiaoPeng
 * @version 1.0
 * @date 2022/5/30 17:56
 */
@Configuration
public class GateWayConfig {
    @Bean
    public RouteLocator configRoute(RouteLocatorBuilder routeLocatorBuilder){
        RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes();
        routes.route("shop-test",r->r.path("/order").uri("lb://shop-order"));
        return routes.build();
    }
}
